Updating State From Properties With React Hooks

And why you shouldn’t change state from useEffect dependencies

Michael Landis
Better Programming
Published in
5 min readDec 14, 2020

--

Large satellite dishes
Photo by Marko Aliaksandr for Shutterstock.

How many times have we wanted to update a component’s internal state with data from its properties? There are a variety of ways to do it, but some come with pitfalls.

The Problem: Props Don’t Always Cut It

--

--